package com.services.impl;

import org.apache.ibatis.session.SqlSession;

import com.services.LoginManager;
import com.util.DBHelper;
import com.bean.Login;
import com.dao.LoginDao;

public class LoginManagerImpl extends DBHelper implements LoginManager {

		private LoginDao  loginDao = null;
		private SqlSession session = null;
	public void insert(Login login) {
		session = super.getSession();
		loginDao = session.getMapper(LoginDao.class);
		loginDao.insert(login);
		session.commit();
		loginDao = null;
		super.close(session);
	}

	public Login Login(Login login) {
		session = super.getSession();
		loginDao = session.getMapper(LoginDao.class);
		Login logins = loginDao.Login(login);
		loginDao = null;
		super.close(session);
		return logins;
	}

}
